<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>每天活跃用户管理</title>
	<meta name="decorator" content="default"/>
	<script type="text/javascript">
		$(document).ready(function() {
			
		});
		function page(n,s){
			$("#pageNo").val(n);
			$("#pageSize").val(s);
			$("#searchForm").submit();
        	return false;
        }
		
		function getMember( aliveMemberId, wechatId){
			$.get("${ctx}/bi/aliveMember/getMemberBy?wechatId="+wechatId, function(result){
				 var map=JSON.parse(result);
			    $("#name"+aliveMemberId).html(map.name);
			    $("#mobile"+aliveMemberId).html(map.mobile);
			  });
		}
	</script>
</head>
<body>
	<ul class="nav nav-tabs">
		<li class="active"><a href="${ctx}/bi/aliveMember/">每天活跃用户列表</a></li>
	</ul>
	<form:form id="searchForm" modelAttribute="aliveMember" action="${ctx}/bi/aliveMember/" method="post" class="breadcrumb form-search">
		<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
		<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
		<label>名称 ：</label><form:input path="name" htmlEscape="false" maxlength="50" class="input-medium"/>
		&nbsp;<input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/>
	</form:form>
	<tags:message content="${message}"/>
	<table id="contentTable" class="table table-striped table-bordered ">
		<thead><tr><shiro:hasPermission name="sys:user:edit"><th>所属商家</th></shiro:hasPermission><th>会员姓名</th><th>用户交互量</th><th>创建时间</th><shiro:hasPermission name="bi:aliveMember:edit"><th>操作</th></shiro:hasPermission></tr></thead>
		<tbody>
		<c:forEach items="${page.list}" var="aliveMember">
			<tr>
				<shiro:hasPermission name="sys:user:edit"><td>${aliveMember.user.name}</td></shiro:hasPermission>
				<td>${aliveMember.wechatId}</td>
				<td>${aliveMember.exchangeCount}</td>
				<td><fmt:formatDate value="${aliveMember.createTime}" type="both"/></td>
				<shiro:hasPermission name="bi:aliveMember:edit"><td>
    				<a  href="#"  data-toggle="modal" data-target="#myModal_${aliveMember.id }" class="btn btn-success" onclick="getMember('${aliveMember.id }','${aliveMember.wechatId}');" >查看用户信息</a>
    				<!-- 回复内容 -->
						<div id="myModal_${aliveMember.id }" class="modal hide fade" tabindex="-1" style="width:900px;margin-left:-500px;"
									role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
									<div class="modal-header">
										<button type="button" class="close" data-dismiss="modal"
											aria-hidden="true">×</button>
										<h3 id="myModalLabel">会员信息</h3>
									</div>
									<div class="modal-body">
										<div class="control-group">
										<label class="control-label">会员姓名:</label>
										<div class="controls" id="name${aliveMember.id}">
										
										</div>
									</div>
									<div class="control-group">
										<label class="control-label">会员手机:</label>
										<div class="controls"  id="mobile${aliveMember.id}">
										
										</div>
									</div>
								</div>
						</div> <!-- 回复内容 结束-->
				</td></shiro:hasPermission>
			</tr>
		</c:forEach>
		</tbody>
	</table>
	<div class="pagination">${page}</div>
</body>
</html>
